package com.vmladenov.cook.core;

import android.content.Context;
import android.content.SharedPreferences;

public class AppSettings
{
	SharedPreferences _preferences;
	
	public static final String DownloadImagesField = "DownloadImages";
	public static final String CacheImagesField = "CacheImages";
	public static final String UseOnlyWiFiField = "UseOnlyWiFi";
	
	public AppSettings()
	{
		Context context = Helpers.getApplicationContext();
		_preferences = context.getSharedPreferences("MandjaSettings", Context.MODE_PRIVATE);
	}
	
	public AppSettings(Context context)
	{
		_preferences = context.getSharedPreferences("MandjaSettings", Context.MODE_PRIVATE);
	}
	
	public AppSettings(SharedPreferences preferences)
	{
		_preferences = preferences;
	}	
	
	public Boolean downloadImages()
	{
		return _preferences.getBoolean("DownloadImages", true);
	}
	
	public Boolean cacheImages()
	{
		return _preferences.getBoolean("CacheImages", true);
	}
	
	public Boolean useOnlyWiFi()
	{
		return _preferences.getBoolean("UseOnlyWiFi", false);
	}
}
